<template>
    <div class="main_box" style="padding:10px">
        <div class="add_wrap">
            <el-form label-width="200px">
                <div class="tit">
                    <h2>基础信息</h2>
                    <el-button type="success" plain size="small" icon="fa fa-mail-forward" @click="returnList">返回
                    </el-button>
                </div>
                <el-row>
                    <el-form-item label="订单编号:">
                        <span>{{ dataInfo.orderNo }}</span>
                    </el-form-item>
                    <el-form-item label="可分账金额:">
                        <span>{{ dataInfo.balance }}</span>
                    </el-form-item>
                    <el-form-item label="已分账金额:">
                        <span>{{ dataInfo.outBalance }}</span>
                    </el-form-item>
                    <el-form-item label="分账状态:">
                        <el-tag effect="dark" :type="formatSplitStates(dataInfo.splitState)">
                            {{ formatSplitStates(dataInfo.splitState) }}
                        </el-tag>
                    </el-form-item>
                </el-row>
            </el-form>
        </div>
    </div>
</template>

<script>
import MchInfoApi from '@/api/account/mchInfo';
export default {
    data() {
        return {
            dataInfo: {},
        };
    },
    computed: {
    },
    mounted() {
        this.getData()
    },
    methods: {
        getData() {
            MchInfoApi.getMchInfo({ id: this.$route.query.id }).then(res => {
                this.dataInfo = res.data
            })
        },
        formatSplitStates(val){
            switch(val){
                case 0:
                    return "danger"
                case 1:
                    return "primary"
                case 2:
                    return "success"
            }
        },
        formatSplitState(val){
            switch(val){
                case 0:
                    return "未分账"
                case 1:
                    return "待分账"
                case 2:
                    return "已分账"
            }
        },
        returnList() {
            this.$store.dispatch('delView', this.$route);
            this.$router.push({ path: '/account/mchInfoManagement' })
        }
    },

}

</script>
<style lang="scss" scoped>
@import "@/assets/css/views/add.scss";
</style>
